import instance from './index.ts';

export type RequestLogin = {
  username: string;
  password: string;
};

export type ResponseLogin = {
  admin: boolean;
  alias: string;
  id: number;
  password: string;
  permissions: string[];
  roles: string[];
  token: string;
  username: string;
};

export const login = (data: RequestLogin) => instance.post<ResponseLogin>('/login', data);

export default login;
